package com.framework.disconf;


import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class CyptoClient
{

  private static final Logger logger = LogManager.getLogger(CyptoClient.class);

  public static final String CHARSET = "UTF-8";

  public static String encryptWithAES(String info, String aeskey) {
		try {
			byte[] key = HexUtil.hexStr2ByteArray(aeskey);
			byte[] bytes = info.getBytes();
			byte[] encrypt = AES256Coder.encrypt(bytes, key);
			return HexUtil.byteArray2HexStr(encrypt);
		} catch (Exception e) {
			logger.error("encrypt执行失败： " + e.getMessage(), e);
		}
		return null;
	}



}